import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
    {
        path: '/',
        name: 'home',
        component: HomeView,
        redirect: '/index',
        children: [
            {
                path: '/index',
                component: () => import('../views/IndexView.vue')
            },
            {
                path: '/info',
                component: () => import('../views/InfoView.vue')
            },
            {
                path: '/ninja', component: () => import('/src/views/Ninja.vue'),
            },
            {
                path: '/xin', component: () => import('/src/views/XinView.vue')
            }
        ]
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes,
    scrollBehavior() {
        return {top: 0}
    },
})

export default router
